package JUC.回调_竟然是个设计模式;

public class Remote {
    public void executeMessage(String msg,CallBack callBack){
        try {
            for (int i = 0; i < 5; i++) {
                Thread.sleep(1000*i);
                System.out.println("异步正在干活");
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("异步干完活 我要回家！");
        callBack.execute(msg);
    }
}
